{extend name='public/layout' /}

{block name='body'}
<div class="layui-card">
	<div class="layui-card-body">
		<div style="padding-bottom: 10px;">
			<a class="layui-btn" href="{:url('create')}">
				<i class="iconfont icon-plus"></i> 添加
			</a>
			<a href="{:url('setstatus','status=1')}" class="layui-btn"
					data-ajax-get="{mustTargetQuery:true,notTargetQueryMsg:'必须选择一个行为',target:'[name=\'ids[]\']'}">
				<i class="iconfont icon-done"></i> 启用
			</a>
			<a href="{:url('setstatus','status=0')}" class="layui-btn"
					data-ajax-get="{mustTargetQuery:true,notTargetQueryMsg:'必须选择一个行为',target:'[name=\'ids[]\']'}">
				<i class="iconfont icon-error"></i> 禁用
			</a>
			<a href="{:url('delete')}" class="layui-btn layui-btn-danger"
					data-ajax-get="{mustTargetQuery:true,notTargetQueryMsg:'必须选择一个行为',target:'[name=\'ids[]\']'}">
				<i class="iconfont icon-delete"></i> 删除
			</a>
		</div>

		<div class="layui-table-responsive">
			<table class="layui-table layui-form" lay-even lay-skin="nob">
				<thead>
				<tr>
					<th width="24">
						<input type="checkbox" id="all-checkbox" data-choice-check data-target="tbody [name='ids[]']" lay-skin="primary"/>
					</th>
					<th width="24">#</th>
					<th>昵称</th>
					<th>性别</th>
					<th>居住</th>
					<th>最后登录时间</th>
					<th>最后登录IP</th>
					<th>积分</th>
					<th style="text-align:center;">状态</th>
					<th style="text-align:center;">操作</th>
				</tr>
				</thead>
				<tbody>
				{volist name="data" id="vo"}
				<tr>
					<td>
						<input type="checkbox" value="{$vo.id}" name="ids[]" lay-skin="primary"/>
					</td>
					<td>{$vo.id}</td>
					<td>
						<span class="text-primary">{$vo.nickName|raw}</span>
						<span style="font-size: 10px;color: gray">({$vo.origin_text})</span>
					</td>
					<td>
						<span class="{$vo.gender==2?'text-danger':'text-primary'}">{$vo.gender_text}</span>
					</td>
					<td>
						<span>{$vo.province}</span>·
						<span>{$vo.city}</span>
					</td>
					<td>
						{$vo.last_login_time|date='Y-m-d H:i'}
					</td>
					<td>
						<p style="font-size: 10px;color: gray">{$vo.last_login_ip}</p>
						<p>{$vo.last_login_ip_addr}</p>
					</td>
					<td>{$vo.energy} <i class="layui-icon layui-icon-rate"></i></td>
					<td style="text-align:center;">
						<a href="{:url('setstatus','ids='.$vo.id.'&status='.($vo.status?0:1))}" title="{$vo.status?'已启用':'已禁用'}"
								data-ajax-get>
							<i class="{$vo.status?'text-success':'text-danger'} iconfont {$vo.status?'icon-done-circle':'icon-close-circle'}"></i>
						</a>
					</td>
					<td style="text-align:center;">
						<a href="{:url('update','id='.$vo.id)}">编辑</a>
						<a href="{:url('delete','ids='.$vo.id)}" class="text-danger" data-ajax-get>删除</a>
					</td>
				</tr>
				{/volist}
				</tbody>
			</table>
		</div>
		{$data|raw}
	</div>

</div>
{/block}
